﻿using JobManageBLL.Config;
using JobManageCommon.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinJobManage
{
    public partial class GetKeyshow : Form
    {
        DBConfig _dBConfig = new DBConfig(Application.StartupPath + @"\key.ini");
        public GetKeyshow()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var Administrator = textBox1.Text.Trim(); 
            var appversion = textBox2.Text.Trim();
            var i1 = _dBConfig.IniWriteValue("ChaiInfo", "Administrator", Administrator);
            var i2 = _dBConfig.IniWriteValue("ChaiInfo", "appversion", appversion); 
            CmdHelper.OpenCmdStarts(Application.StartupPath, Administrator, appversion);
        }
         

        private void GetKeyshow_Load(object sender, EventArgs e)
        {
            textBox1.Text = _dBConfig.IniReadValue("ChaiInfo", "Administrator");
            textBox2.Text = _dBConfig.IniReadValue("ChaiInfo", "appversion");
        }
    }
}
